#include "PthreadPool.h"
#include "calculation.h"
#include "Singleton.h"

void pool_text()
{
    MyPthreadPool::PthreadPool<calculator> pool(5);
    pool.InitPthreadPool();
    std::string symbol = "+-*/";
    while (true)
    {
        calculator c(rand() % 1000, symbol[rand() % symbol.size()], rand() % 1000);
        pool.Push(c);
    }
}
void singleton_text()
{
    std::string symbol = "+-*/";
    while (true)
    {
        calculator c(rand() % 1000, symbol[rand() % symbol.size()], rand() % 1000);
        Singleton::PthreadPool<calculator>::GetInstance()->Push(c);
    }
}
int main()
{
    srand((long)time(nullptr));
    // pool_text();
    singleton_text();
    return 0;
}
